#include <qwsevent_qws.h>

#include "RemoconApp.h"

RemoconApp::RemoconApp(int argc, char **argv): QPEApplication(argc, argv)
{}

bool RemoconApp::qwsEventFilter(QWSEvent *e)
{
	if (e->type != QWSEvent::Key)
		return QPEApplication::qwsEventFilter(e);
	
	QWSKeyEvent *k = static_cast<QWSKeyEvent *>(e);
	if (!k->simpleData.is_press)
		return QPEApplication::qwsEventFilter(e);
	
	switch (k->simpleData.keycode)
	{
		case Qt::Key_F9:	// Calendar
		case Qt::Key_F10:	// Address
		case Qt::Key_F12:	// Home
		case Qt::Key_F13:	// Mail
		case Qt::Key_F14:	// hold Mail
		case Qt::Key_F21:	// 全/半
		case Qt::Key_F22:	// Fn
		case Qt::Key_F23:	// Fn + Space
		case Qt::Key_F25:	// Fn + 全/半
		case Qt::Key_F26:	// カナひら
		case Qt::Key_F31:	// Fn + カナひら
		case Qt::Key_F32:	// hold Calendar
		case Qt::Key_F33:	// OK
		case Qt::Key_CapsLock:
		case Qt::Key_Escape:
		case Qt::Key_Print:
		case 0x200f:	// Fn + 1
		case 0x2010:	// Fn + 2
		case 0x2012:	// Fn + 3
		case 0x2011:	// Fn + 4
		case 0x201b:	// Fn + 5
		case 0x200a:	// Fn + 6
		case 0x200b:	// Fn + 7
		case 0x200c:	// Fn + 8
		case 0x2007:	// Fn + 9
		case 0x2008:	// Fn + 0
		case 0x2014:	// Fn + Q
		case 0x2017:	// Fn + A
		case 0x2018:	// Fn + S
		case 0x2015:	// Fn + O
		case 0x2016:	// Fn + P
		case 0x2019:	// Fn + N
		case 0x201a:	// Fn + M
			return QApplication::qwsEventFilter(e);
	}
	
	return QPEApplication::qwsEventFilter(e);
}
